@import (reference) "@/styles/variables.less";

.auth-page {
  .auth-page__container {
    height: 100vh;
  width: 100vw;
  background: linear-gradient(135deg, @gray-900 0%, @purple-900 50%, @gray-900 100%);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  }

  .auth-page__content {
    flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: @spacing-2xl;
  padding-right: @spacing-2xl;
  }

  .auth-page__card {
    width: 100%;
  max-width: 448px;

    .auth-page__card-inner {
      background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  border-radius: 24px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: @spacing-2xl;

      .auth-page__header {
        text-align: center;
  margin-bottom: @spacing-2xl;

        .auth-page__icon-container {
          width: 64px;
  height: 64px;
  background: linear-gradient(135deg, @purple-500 0%, @pink-500 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto @spacing-xl auto;

          .auth-page__icon {
            width: 32px;
  height: 32px;
  color: @white;
          }
        }

        .auth-page__title {
          font-size: @font-size-3xl;
  font-weight: 700;
  color: @white;
  margin-bottom: @spacing-sm;
        }

        .auth-page__subtitle {
          color: rgba(255, 255, 255, 0.7);
        }
      }

      .auth-page__error {
        padding: @spacing-lg;
  margin-bottom: @spacing-xl;
  background: rgba(239, 68, 68, 0.2);
  backdrop-filter: blur(4px);
  border-radius: 12px;
  border: 1px solid rgba(239, 68, 68, 0.3);

        .auth-page__error-text {
          font-size: @font-size-sm;
  color: rgba(254, 226, 226, 0.8);
        }
      }

      .auth-page__form {
        & > * + * {
    margin-top: @spacing-xl;
  }

        .auth-page__field {
          .auth-page__field-label {
            display: block;
  margin-bottom: @spacing-md;
  font-size: @font-size-sm;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
          }

          .auth-page__field-input-container {
            position: relative;

            .auth-page__field-icon {
              display: flex;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  align-items: center;
  padding-left: @spacing-lg;
  pointer-events: none;

              .auth-page__field-icon-svg {
                width: 20px;
  height: 20px;
  color: rgba(255, 255, 255, 0.6);
              }
            }

            .auth-page__field-input {
              width: 100%;
  padding: @spacing-lg @spacing-lg @spacing-lg 48px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  color: @white;
  
  &::placeholder {
    color: rgba(255, 255, 255, 0.5);
  }
  
  &:focus {
    outline: none;
    border-color: transparent;
    box-shadow: 0 0 0 2px @purple-500;
  }
  
  transition: all @transition-slow;

              &.auth-page__field-input--error {
                border-color: @red-400;
  
  &:focus {
    box-shadow: 0 0 0 2px @red-500;
  }
              }
            }

            .auth-page__field-toggle {
              display: flex;
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  align-items: center;
  padding-right: @spacing-lg;
  color: rgba(255, 255, 255, 0.6);
  transition: color @transition-normal;
  
  &:hover {
    color: @white;
  }

              .auth-page__field-toggle-icon {
                width: 20px;
  height: 20px;
              }
            }
          }

          .auth-page__field-error {
            margin-top: @spacing-sm;
  font-size: @font-size-sm;
  color: rgba(254, 202, 202, 0.8);
          }

          .auth-page__password-strength {
            margin-top: @spacing-md;

            .auth-page__password-strength-container {
              display: flex;
  align-items: center;
  gap: @spacing-md;

              .auth-page__password-strength-bar {
                flex: 1;
  height: 8px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 9999px;
  overflow: hidden;

                .auth-page__password-strength-fill {
                  height: 100%;
  transition: all @transition-slow;

                  &.auth-page__password-strength-fill--weak {
                    background: @red-500;
                  }

                  &.auth-page__password-strength-fill--medium {
                    background: @yellow-500;
                  }

                  &.auth-page__password-strength-fill--strong {
                    background: @green-500;
                  }
                }
              }

              .auth-page__password-strength-label {
                font-size: @font-size-xs;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
              }
            }
          }
        }

        .auth-page__options {
          display: flex;
  justify-content: space-between;
  align-items: center;

          .auth-page__checkbox {
            display: flex;
  align-items: center;

            .auth-page__checkbox-input {
              width: 16px;
  height: 16px;
  border-radius: @border-radius;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
  color: @purple-500;
  
  &:focus {
    box-shadow: 0 0 0 2px @purple-500;
    outline: none;
  }

              &.auth-page__checkbox-input--error {
                border-color: @red-400;
              }
            }

            .auth-page__checkbox-label {
              display: block;
  margin-left: @spacing-md;
  font-size: @font-size-sm;
  color: rgba(255, 255, 255, 0.8);
            }
          }

          .auth-page__forgot-password {
            font-size: @font-size-sm;
  font-weight: 500;
  color: rgba(216, 180, 254, 0.8);
  transition: color @transition-normal;
  
  &:hover {
    color: rgba(233, 213, 255, 0.8);
  }
          }
        }

        .auth-page__terms {
          .auth-page__terms-container {
            display: flex;
  align-items: flex-start;

            .auth-page__terms-checkbox {
              margin-top: @spacing-xs;
  width: 16px;
  height: 16px;
  border-radius: @border-radius;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
  color: @purple-500;
  
  &:focus {
    box-shadow: 0 0 0 2px @purple-500;
    outline: none;
  }

              &.auth-page__terms-checkbox--error {
                border-color: @red-400;
              }
            }

            .auth-page__terms-label {
              display: block;
  margin-left: @spacing-md;
  font-size: @font-size-sm;
  color: rgba(255, 255, 255, 0.8);

              .auth-page__terms-link {
                font-weight: 500;
  color: rgba(216, 180, 254, 0.8);
  transition: color @transition-normal;
  
  &:hover {
    color: rgba(233, 213, 255, 0.8);
  }
              }
            }
          }

          .auth-page__terms-error {
            margin-top: @spacing-sm;
  font-size: @font-size-sm;
  color: rgba(254, 202, 202, 0.8);
          }
        }

        .auth-page__submit {
          width: 100%;
  background: linear-gradient(to right, @purple-500, @pink-500);
  color: @white;
  font-weight: 600;
  padding: @spacing-lg @spacing-xl;
  border-radius: 12px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  transition: all @transition-slow;
  transform: none;
  
  &:hover {
    background: linear-gradient(to right, @purple-600, @pink-600);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    transform: scale(1.02);
  }
  
  &:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }

          .auth-page__submit-loading {
            display: flex;
  align-items: center;
  justify-content: center;

            .auth-page__submit-spinner {
              width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: @white;
  border-radius: 9999px;
  animation: spin 1s linear infinite;
  margin-right: @spacing-sm;
            }
          }
        }
      }

      .auth-page__footer {
        margin-top: @spacing-2xl;
  text-align: center;

        .auth-page__footer-text {
          font-size: @font-size-sm;
  color: rgba(255, 255, 255, 0.7);

          .auth-page__footer-link {
            color: rgba(216, 180, 254, 0.8);
  font-weight: 500;
  transition: color @transition-normal;
  
  &:hover {
    color: rgba(233, 213, 255, 0.8);
  }
          }
        }
      }
    }
  }

  // 响应式设计
  @media (max-width: @screen-sm) {
    .auth-page__card {
      .auth-page__card-inner {
        padding: @spacing-xl;
      }
    }

    .auth-page__options {
      display: flex;
  flex-direction: column;
  align-items: flex-start;
  & > * + * {
    margin-top: @spacing-md;
  }

      .auth-page__forgot-password {
        margin-top: @spacing-sm;
      }
    }
  }
}

// 登录页面特定样式
.login-page {
  .login-page__container {
    .auth-page__content;
  }
}

// 注册页面特定样式
.register-page {
  .register-page__container {
    .auth-page__content;
  }
}